<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" type="text/css" href="../../css/aui.css">
    <link rel="stylesheet" type="text/css" href="../../css/aui-slide.css">
    <link rel="stylesheet" type="text/css" href="../../css/api.css">
    <script type="text/javascript" src="../../script/api.js"></script>
</head>

<body>
    <header id="header" class="aui-bar aui-bar-nav aui-bar-pink">
        <a href="" class="aui-pull-left"><span class="aui-iconfont aui-icon-left" onclick="api.closeWin()"></span></a>
        <div class="aui-title">我的评论</div>
        <a class="aui-pull-right aui-btn aui-btn-outlined">
            <span class="aui-iconfont aui-icon-gear"></span>
        </a>
    </header>
    <section class="aui-content-padded" id="comment_1">

    </section>
</body>
<script type="text/javascript">
    apiready = function() {
        var comment_list = $api.byId('comment_list');
        var body = {
            token: $api.getStorage('token')
        };
        api.ajax({
            url: 'http://www.mk517.com/webApi/comment.php',
            method: 'post',
            "headers": {
                "Content-Type": "application/json"
            },
            dataType: "json",
            data: {
                body: body
            }
        }, function(ret, err) {
            if (ret) {
                for (var i = 0; i < ret.length; i++) {
                    var data = ret[i];
                    $api.byId('comment_1').innerHTML += '<div class="aui-content aui-margin-b-15">'+
                    '<ul class="aui-list aui-media-list">'+
                    '<li class="aui-list-item aui-list-item-middle">'+
                    '<div class="aui-media-list-item-inner">'+
                    '<div class="aui-list-item-media" style="width: 3rem;">'+
                    '<img src="'+data.comment_user_avater+'" class="aui-img-round aui-list-img-sm">'+
                    '</div>'+
                    '<div class="aui-list-item-inner">'+
                    '<div class="aui-list-item-text">'+
                    '<div class="aui-list-item-title aui-font-size-14">'+data.comment_username+'</div>'+
                    '<div class="aui-list-item-right">'+data.comment_time+'</div>'+
                    '</div>'+
                    '<div class="aui-list-item-text">'+data.comment_goods_content+'</div></div></div></li></ul></div>'

                }
                // alert(JSON.stringify(ret));
            } else {
                // alert(JSON.stringify(err));
            }
        });

    }
</script>

</html>
